<template>
  <div class="personal-center-container">
    <div class="page-header">
      <h2>个人中心</h2>
    </div>
    
    <div class="profile-section">
      <div class="profile-card">
        <div class="profile-avatar">
          <div class="avatar">👤</div>
        </div>
        <div class="profile-info">
          <h3>张三</h3>
          <p>普通用户</p>
          <button class="btn-primary">编辑资料</button>
        </div>
      </div>
    </div>
    
    <div class="stats-grid">
      <div class="stat-card">
        <div class="stat-icon">📝</div>
        <div class="stat-content">
          <h3>我的贡献</h3>
          <p class="stat-number">23</p>
          <span class="stat-label">篇知识</span>
        </div>
      </div>
      
      <div class="stat-card">
        <div class="stat-icon">⭐</div>
        <div class="stat-content">
          <h3>我的收藏</h3>
          <p class="stat-number">156</p>
          <span class="stat-label">个收藏</span>
        </div>
      </div>
      
      <div class="stat-card">
        <div class="stat-icon">❓</div>
        <div class="stat-content">
          <h3>我的提问</h3>
          <p class="stat-number">89</p>
          <span class="stat-label">个问题</span>
        </div>
      </div>
      
      <div class="stat-card">
        <div class="stat-icon">💬</div>
        <div class="stat-content">
          <h3>我的回答</h3>
          <p class="stat-number">67</p>
          <span class="stat-label">个回答</span>
        </div>
      </div>
    </div>
    
    <div class="recent-activity">
      <h3>最近活动</h3>
      <div class="activity-list">
        <div class="activity-item">
          <span class="activity-icon">📝</span>
          <div class="activity-content">
            <p>创建了新知识《Vue.js 最佳实践》</p>
            <span class="activity-time">2小时前</span>
          </div>
        </div>
        <div class="activity-item">
          <span class="activity-icon">⭐</span>
          <div class="activity-content">
            <p>收藏了《React 开发指南》</p>
            <span class="activity-time">1天前</span>
          </div>
        </div>
        <div class="activity-item">
          <span class="activity-icon">❓</span>
          <div class="activity-content">
            <p>提出了问题：如何优化Vue性能？</p>
            <span class="activity-time">2天前</span>
          </div>
        </div>
        <div class="activity-item">
          <span class="activity-icon">💬</span>
          <div class="activity-content">
            <p>回答了问题：Vue和React的区别</p>
            <span class="activity-time">3天前</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
// 个人中心组件逻辑
</script>

<style scoped>
.personal-center-container {
  padding: 0;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-header h2 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.profile-section {
  margin-bottom: 2rem;
}

.profile-card {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 2rem;
}

.profile-avatar {
  flex-shrink: 0;
}

.avatar {
  width: 4rem;
  height: 4rem;
  background: var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.profile-info {
  flex: 1;
}

.profile-info h3 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

.profile-info p {
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
}

.btn-primary {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 500;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  font-size: 2rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 0.5rem;
}

.stat-content {
  flex: 1;
}

.stat-content h3 {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0 0 0.5rem 0;
}

.stat-number {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.recent-activity {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.recent-activity h3 {
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 0.5rem;
}

.activity-icon {
  font-size: 1.25rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border-radius: 0.375rem;
}

.activity-content {
  flex: 1;
}

.activity-content p {
  color: var(--text-primary);
  font-size: 0.875rem;
  margin: 0 0 0.25rem 0;
}

.activity-time {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

@media (max-width: 768px) {
  .profile-card {
    flex-direction: column;
    text-align: center;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
</style>
